﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using KPIS.GERP.GIMS.MODEL;
using KPIS.GERP.GIMS.IBLL;
using KPIS.GERP.GIMS.IDAL;
using KPIS.GERP.GIMS.DALFactory;

namespace KPIS.GERP.GIMS.BLL
{
    public class TreeBLL : IBLLTree
    {
        private static readonly IDALTree dal = DataAccess.CreateTree();

        public TreeBLL()
        {

        }

        public IList<TreeInfo> GetResourceMasterTree()
        {
            return dal.GetResourceMasterTree();
        }

        public IList<TreeInfo> GetResourceMasterTree(string parent_id)
        {
            if (parent_id == null)
                return null;

            return dal.GetResourceMasterTree(parent_id);
        }

        public IList<TreeInfo> GetResourceMasterTreeResultSearch(string text_search)
        {
            return dal.GetResourceMasterTreeResultSearch(text_search);
        }


        public IList<TreeInfo> GetResourceMasterTreeByTypeCode(int TypeCode)
        {
            return dal.GetResourceMasterTreeByTypeCode(TypeCode);  
        }


        public IList<TreeInfo> GetResourceMasterTreeWithoutHeader(string parent_id)
        {
            if (parent_id == null)
                return null;

            return dal.GetResourceMasterTreeWithoutHeader(parent_id);
        }


        public IList<TreeInfo> GetJobSiteTree()
        {
            return dal.GetJobSiteTree();
        }

        public IList<TreeInfo> GetJobSiteTreeOnDemand(string parent_id)
        {
            return dal.GetJobSiteTreeOnDemand(parent_id);
        }

        public IList<TreeInfo> GetReceiveItemTree()
        {
            return dal.GetReceiveItemTree();
        }

        public IList<TreeInfo> GetReceiveItemTreeOnDemand(string parent_id, Nullable<int> ReceiveSeq)
        {
            return dal.GetReceiveItemTreeOnDemand(parent_id, ReceiveSeq);
        }
        public IList<TreeInfo> GetWarehouseConsumeJobSiteTree(Nullable<int> warehouse_seq)
        {
            return dal.GetWarehouseConsumeJobSiteTree(warehouse_seq);
        }

        public IList<TreeInfo> GetPurchaseMethodTree()
        {
            return dal.GetPurchaseMethodTree();
        }

        public IList<TreeInfo> GetBgmExpensePlan()
        {
            return dal.GetBgmExpensePlan();
        }

        public IList<TreeInfo> GetBgmExpenseProject(int bgm_year, int job_site_seq)
        {
            return dal.GetBgmExpenseProject(bgm_year, job_site_seq);
        }

        public IList<TreeInfo> GetBgmExpenseProjectOperation(int bgm_year, int job_site_seq)
        {
            return dal.GetBgmExpenseProjectOperation(bgm_year, job_site_seq);
        }

        public IList<TreeInfo> GetAllBgmSourceTree()
        {
            return dal.GetAllBgmSourceTree();
        }

        public IList<TreeInfo> GetBgmSourceTreeWithRule(int rule_seq)
        { 
            return dal.GetBgmSourceTreeWithRule(rule_seq);
        }
    }
}
